/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package circlerectanglecollision;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.JFrame;

/**
 *
 * @author danh.ngothanh
 */
public class MainFrame extends JFrame implements KeyListener{

    private MainPanel m_mainpanel;
    public MainFrame(){
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setResizable(false);
        setBounds(50, 50, 1200, 650);
        setAlwaysOnTop(true);       
    }

    public void Init(){
        addKeyListener(this);
        m_mainpanel = new MainPanel();
        m_mainpanel.Init();
        setContentPane(m_mainpanel);
    }

    public void keyTyped(KeyEvent e) {

    }

    public void keyPressed(KeyEvent e) {
        if(e.getKeyCode() == KeyEvent.VK_ESCAPE){
            System.gc();
            System.exit(0);
        }
    }

    public void keyReleased(KeyEvent e) {
        
    }

}
